// ActionScript file
package com.app.commands{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.app.business.PengumumanDelegate;
	import com.app.control.GetPengumumanByDosenIdEvent;
	import com.app.model.ModelLocator;
	import com.app.vo.PengumumanVO;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	
    
    public class GetPengumumanByDosenIdCommand implements ICommand,IResponder{
        private var model:ModelLocator=ModelLocator.getInstance();
        
        public function execute (event:CairngormEvent):void{
            model.pengumuman.isPending=true;
            var delegate:PengumumanDelegate=new PengumumanDelegate(this);
            var getPengumumanByDosenIdEvent:GetPengumumanByDosenIdEvent= GetPengumumanByDosenIdEvent(event);
            delegate.getListPengumumanByDosenId(getPengumumanByDosenIdEvent.pengumumanVo);
        }
        public function result(data:Object):void{
            model.pengumuman.isPending=false;
            model.pengumuman.pengumumanVo=PengumumanVO(data);
        }
        
        public function fault(info:Object):void{
            Alert.show( "Get Info Dosen Failed","Alert");
            model.pengumuman.isPending = false;
        }
    }
}